package dao;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.SQLException;

import entity.Student;
import util.PZUtil;

public class StudentDao {
	public void insert(Student stu){
		Connection con=PZUtil.getConnection();
		String sql="insert into stu_info(stu_number,stu_name,stu_age) values(?,?,?)";
		PreparedStatement ps;
		try {
			ps = con.prepareStatement(sql);
			ps.setInt(1, stu.getStu_number());
			ps.setString(2, stu.getStu_name());
			ps.setInt(3, stu.getStu_age());
			ps.executeUpdate();
		} catch (SQLException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		
	}
}
